import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import ProductList from '@/components/ProductList'
import User from '@/pages/User'
import Cart from '@/pages/cart'
import Home from '@/pages/Home'
import Category from '../pages/Category.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld,
      children: [{
        path: '/category',
        name: 'category',
        component: Category,
        children: [{
          path: ':categoryId',
          name: 'ProductList',
          component: ProductList
        }],
      },
      {
        path: '/user',
        name: 'user',
        component: User
      },
      {
        path: '/cart',
        name: 'cart',
        component: Cart
      },
      {
        path:"/home",
        name:"home",
        component:Home
      }
      ]
    }
  ]
})
